Make canvas.set_logical_size lazy again #148
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
In #141 I made it such that when
canvas.set_logical_size()is called (either by the user, or as part of initializing the widget), the logical size of the widget is immediately set. Since the widget may take a while to actually resize (think of widget embedded in a GUI, or a jupyter canvas), there is temporarily a very weird pixel ratio.The idea for this change was that code that instantiate a widget and then directly try to use its logical size, have a (likely) correct value to work with already.
But I'm not pretty sure this was a mistake; the temporary phase were the logical size and physical size are "out of sync" is short, but it breaks assumptions, and makes it hard to explain what "logical size" really means.